package com.mvc4g.test.client.action;

import com.mvc4g.client.ActionInterface;
import com.mvc4g.client.Controller;
import com.mvc4g.test.client.Constants;
import com.mvc4g.test.client.view.PageView;
import com.mvc4g.test.client.view.RootTemplate;

public class ChangePageAction implements ActionInterface, Constants {
	
	int number = 0;
	
	
	public ChangePageAction(int number){
		this.number = number;
	}

	@Override
	public void execute(Controller controller, Object form) {		
		RootTemplate rootView = (RootTemplate) controller.getView(ROOT_TEMPLATE);
		PageView view = (PageView) controller.getView(VIEW + number);
		rootView.changePage(view);
	}

}
